-
Notifications
You must be signed in to change notification settings - Fork 447
More micro benchmarks #1158
More micro benchmarks #1158
Conversation
BrennanConroy
commented
Nov 27, 2017
|
Added another micro benchmark for broadcasting to many clients using |
|
Hmm, wonder if we should put the connection count in as the Operation count for each of those iterations. The "Op/s" value is kinda distractingly unrelated since there are inherently more operations performed in each |
|
We should be aware of what |
analogrelay
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good but I already want more ;P
| private TestBinder _binder; | ||
| private HubMessage _hubMessage; | ||
|
|
||
| [Params(Message.Small, Message.Medium, Message.Large)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use descriptive names rather than Small/Medium/Large. Also, there are kinda two axes here: Number of payload values, size of payload values. We should see if we can cross-product them a little (e.g. a test that serializes a single 4K string, and a test that serializes 4K 1 byte strings). I think aiming for 2-3 "expected scenarios" (e.g. 3-4 small values, 8-10 small values, 1 very large value) and then a couple "extreme" scenarios (lots of small values, one extraordinarily large value) would be good. Assuming that doesn't balloon the run time too much :).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would balloon it like crazy, I think it already takes 13 minutes for this benchmark
| switch (Input) | ||
| { | ||
| case Message.Small: | ||
| _hubMessage = new CancelInvocationMessage("123"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use the same message type for all of these tests. If that makes "Small" bigger, so be it.
|
What we're most interested in is how well it scales. Is it linear per connection (ideal) or is there some multiplier effect as more connections arrive. As long we understand clearly how to find that data, I don't mind. Ideally, |
|
So ignoring 1 connection for now, 10 connections was ~300k Op/s, 1000 connections was ~3k Op/s, not shown but done during testing 100 connections was ~30k Op/s |
|
Nice |
analogrelay
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reach for the moon @BrennanConroy ! Bigger payload! Otherwise good to go (and if that makes the benchmark super slow, just make it a power of two and merge as-is)
| _hubMessage = new InvocationMessage("123", true, "Target", null, 1, "string", 2.0f, true, (byte)9, new byte[] { 5, 4, 3, 2, 1 }, 'c', 123456789101112L); | ||
| break; | ||
| case Message.LargeArguments: | ||
| _hubMessage = new InvocationMessage("123", true, "Target", null, new string('F', 1234), new byte[1000]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
larger Larger
LARGER
But seriously, let's try 10 KB (10240) and see how it performs, if the benchmark is super slow, then scale it back. Also use a power of two, not a power of ten, jeez.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Psh power of two is too clean, computers like those, we don't want to be nice to the computer